home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1984 January to June
/
Ahoy_Magazine_84-Jan-Jun_1984_Double_L.d64
/
commodares #5-2
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
393b
|
15 lines
0 rem--ahoy!--may issue--commodares #5--prog page 92
1 rem << prob 4-4 : random repetition
2 rem rvs on=chr$(18):rvs off=chr$(146)
3 rem - flag is true (-1) when previous a% equals previous b%
5 flag=0
10 a%=rnd(0)*10
20 b%=rnd(0)*10
30 if not flag then print chr$(146);
35 rem - lines 40 & 50 determine the next state of the flag
40 flag=0
50 if a%=b% then print chr$(18);:flag=-1
60 print a%;
70 a%=b%
80 goto 20